/**
 * Framework which provide a way of executing a function
 * after the page is loaded (e.g. all ids are available and so)
 * 
 */
function OnLoad() {
	if (window.addEventListener){ 
		// IE
		window.addEventListener("load", OnLoad.fire, false); 
	} else if (window.attachEvent){
		// Gecko
		var r = window.attachEvent("onload", OnLoad.fire); 
	} else { 
		window.onload = OnLoad.fire;
	} 
	this.arrayOfFuncs = [];
}
OnLoad.prototype.fire = function() {
	for (var index in this.arrayOfFuncs) {
		this.arrayOfFuncs[index]();
	}
}
OnLoad.fire = function() {
	OnLoad.getOnLoad().fire();
	return true;
}
OnLoad.prototype.add = function(func) {
	this.arrayOfFuncs.push(func);
}
OnLoad.getOnLoad = function() {
	if (typeof(onLoad) == "undefined" || onLoad == null) {
		onLoad = new OnLoad();
	}
	return onLoad;
}

var onLoad = OnLoad.getOnLoad();